package com.zygvip.demand.entity;

import com.google.common.base.Objects;
import com.zygvip.demand.core.BaseEntity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Description
 *
 * @author 马乌提
 * @create 2018-02-05 15:36
 */
@Entity
@Table(name = "app_industry", schema = "demand", catalog = "")
public class AppIndustry extends BaseEntity {

    private Integer id;
    private String title;
    private Integer sort;
    private Integer parentId;
    private Timestamp gmtCreated;
    private Timestamp gmtModified;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "sort")
    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Basic
    @Column(name = "parent_id")
    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "gmt_created")
    public Timestamp getGmtCreated() {
        return gmtCreated;
    }

    public void setGmtCreated(Timestamp gmtCreated) {
        this.gmtCreated = gmtCreated;
    }

    @Basic
    @Column(name = "gmt_modified")
    public Timestamp getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(Timestamp gmtModified) {
        this.gmtModified = gmtModified;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        AppIndustry that = (AppIndustry) o;
        return Objects.equal(getId(), that.getId()) &&
                Objects.equal(getTitle(), that.getTitle()) &&
                Objects.equal(getSort(), that.getSort()) &&
                Objects.equal(getParentId(), that.getParentId()) &&
                Objects.equal(getGmtCreated(), that.getGmtCreated()) &&
                Objects.equal(getGmtModified(), that.getGmtModified());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(super.hashCode(), getId(), getTitle(), getSort(), getParentId(), getGmtCreated(), getGmtModified());
    }

    @Override
    public String toString() {
        return "AppIndustry{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", sort=" + sort +
                ", parentId=" + parentId +
                ", gmtCreated=" + gmtCreated +
                ", gmtModified=" + gmtModified +
                '}';
    }
}
